package com.cwh.taskcenter.reward.gateway;

import com.cwh.taskcenter.domain.reward.gateway.UserPointRecordGateWay;
import com.cwh.taskcenter.domain.reward.model.UserPointRecord;
import com.cwh.taskcenter.reward.converter.UserPointRecordConverter;
import com.cwh.taskcenter.reward.mapper.UserPointRecordMapper;
import com.cwh.taskcenter.reward.model.UserPointRecordDO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @author cwh
 */
@Slf4j
@Repository
@RequiredArgsConstructor
public class UserPointRecordGateWayImpl implements UserPointRecordGateWay {

    @Autowired
    private UserPointRecordMapper userPointRecordMapper;

    @Override
    public void save(UserPointRecord userPointRecord) {
        UserPointRecordDO userPointRecordDO = UserPointRecordConverter.toUserPointRecordDO(userPointRecord);
        userPointRecordMapper.create(userPointRecordDO);
    }
}
